Auto-configuration

Any (robotics) problem is defined by some parameters. In WOLF, we want to have an easy and flexible method of providing these parameters to the WOLF problem.

We approach this with the objective of facilitating the end-user experience in three stages:

  • Configuration: The end-user do not have to implement anything, a problem is only specified with a configuration file.

  • Validation: The configuration file defined by the user is automatically validated freeing the developer to check input correctness and providing a comprehensive and complete error communication to the user.

  • Execution: The end-user do not have to include and/or link WOLF plugins and packages.

Therefore, any user that only wants to use the library has to just provide a config file(s) and WOLF will automatically build the necessary infrastructure to solve the SLAM problem. For convenience we have decided to use the YAML file format and yaml-cpp as the parsing library.

To accomplish these objectives, WOLF implements an autoconfiguration process. The figure below shows its main steps and the involved components.

digraph foo {
node[style=rounded, shape=box]
"YAML\nfile(s)" [shape="note"]
"Registered\nschemas" [shape="folder"]
"load()" [style="" penwidth=2 fontname="Monospace"]
"search\n& load\nplugins" [style="" penwidth=2 fontname="Monospace"]
"YAML\nvalidation" [style="" penwidth=2 fontname="Monospace"]
"create\nWOLF\ntree" [style="" penwidth=2 fontname="Monospace"]
{rank=same
"YAML\nfile(s)"
"load()"
"YAML::Node"
"search\n& load\nplugins"
"Registered\nschemas"
"YAML\nvalidation"
"YAML::Node\nvalidated"
"create\nWOLF\ntree"}

"YAML\nfile(s)" -> "load()" -> "YAML::Node" -> "search\n& load\nplugins";
"search\n& load\nplugins" -> "Registered\nschemas";
"search\n& load\nplugins" -> "Registered\ncreators";
"YAML::Node" -> "YAML\nvalidation";
"Registered\nschemas" -> "YAML\nvalidation";
"YAML\nvalidation" -> "YAML::Node\nvalidated";
"YAML::Node\nvalidated" -> "create\nWOLF\ntree";
"Registered\ncreators" -> "create\nWOLF\ntree";
}

showing the following items:

  • YAML file(s): these are configuration files written by the user in YAML format.

  • load(): A yaml-cpp basic method for loading a YAML file into a YAML::Node.

  • YAML::Node: A C++ object defined by yaml-cpp library. It contains all the parameters of the input YAML file.

  • Search & load plugins: A WOLF function that itereates the YAML::Node looking for all the plugins mentioned in the configuration file. Then, it dynamically loads the plugins (.so files). At that time, each loaded plugin will register several creators in the different WOLF factories, and the installed schema folders in the folder registry.

  • Registered creators: In the several WOLF factories, the loaded plugins will have registered the corresponding creators (sensors, processors, etc.).

  • Registered schemas: In the WOLF folder regitry, the loaded plugins will have registered the folder containing the installed schemas.

  • YAML validation: The procedure of validating the user-defined YAML input against the corresponding schemas. If correct, the output is a validated YAML::Node completed with default values. Otherwise the user will obtain a comprehensive and complete error message.

  • Create WOLF tree: Taking the YAML::Node with the whole problem specification and using the corresponding factories, the WOLF tree can be configured (see WOLF tree - configuration phase).

This procedure is implemented in Problem::autoSetup().

If the YAML loading and validation already occurred before (for instance in the ROS node), it can be skipped, simplifying the process:

digraph foo {
 ratio=0.2
 node[style=rounded, shape=box]
 "create\nWOLF\ntree" [style="" penwidth=2 fontname="Monospace"]
 "load\nplugin" [style="" penwidth=2 fontname="Monospace"]
 {rank=same
 "YAML::Node\nvalidated"
 "create\nWOLF\ntree"}
 {rank=same
 "load\nplugin"
 "Registered\ncreators"}

 "YAML::Node\nvalidated" -> "create\nWOLF\ntree";
 "Registered\ncreators" -> "create\nWOLF\ntree";
 "create\nWOLF\ntree" -> "load\nplugin"
 "load\nplugin" -> "Registered\ncreators";
}

The following subsections describe in detail the most important features involved in the WOLF autoconfiguration process:

See also

Check the yaml-cpp tutorial.